<template>
  <div>
    <h1>$nexTick</h1>
    <p ref="pp">{{msg}}</p>
    <button @click="changeMsg">111111</button>
    <br>
  <br>
<input type="text" ref="isRsy" v-if="isRss">
<button v-else @click="isRyy">点击切换</button>

  </div>
</template>

<script>
export default {
  name: 'VueDemoApp',

  data() {
    return {
      msg:'饶思泳',
      isRss:false
    };
  },

  mounted() {
    
  },

  methods: {
    changeMsg(){
      this.msg='饶饶饶'
      this.$nextTick(()=>{
        console.log(this.$refs.pp.innerHTML);
      })
    },
    isRyy(){
this.isRss=true
this.$nextTick(()=>{
  this.$refs.isRsy.focus()
})
    }
  },
};
</script>

<style lang="scss" scoped>

</style>